import { createBrowserRouter } from 'react-router-dom'

/// 引入路由表
const metaRoutersData = import.meta.glob('./modules/*.tsx', { eager: true }),
  metaRoutersList = []
Object.keys(metaRoutersData).forEach(item => {
  Object.keys(metaRoutersData[item]).forEach(it => {
    metaRoutersList.push(...metaRoutersData[item][it])
  })
})

export default createBrowserRouter([...metaRoutersList])
